package com.itheima.dubbo.api;

import com.tanhua.model.enums.CommentType;
import com.tanhua.model.mongoDb.Movement;
import com.tanhua.model.vo.PageResult;

import java.util.List;

/**
 * @Author Pan Rundong
 * @Date 2023-02-28 23:51
 * @Desc 动态Api
 */
public interface MovementsApi {
    /**
     * 发布动态
     *
     * @param movement
     * @return void
     * @Author Pan Rundong
     */
    void publicMovements(Movement movement);

    /**
     * 根据id分页查询个人动态
     *
     * @param page
     * @param pagesize
     * @param userId
     * @return com.tanhua.model.vo.PageResult
     * @Author Pan Rundong
     */
    PageResult findById(Integer page, Integer pagesize, Long userId);

    /**
     * 根据Id查询好友动态
     *
     * @param page
     * @param pagesize
     * @param userId
     * @return com.tanhua.model.vo.PageResult
     * @Author Pan Rundong
     */
    PageResult friendsMovements(Integer page, Integer pagesize, Long userId);

    /**
     * 根据动态Pid获取动态信息
     *
     * @param page
     * @param pagesize
     * @param pids
     * @return com.tanhua.model.vo.PageResult
     * @Author Pan Rundong
     */
    PageResult recommend(Integer page, Integer pagesize, List<Long> pids);

    /**
     * 随机获取动态
     *
     * @param pagesize
     * @return com.tanhua.model.vo.PageResult
     * @Author Pan Rundong
     */
    PageResult randomRecommend(Integer pagesize);

    /**
     * 根据动态Id获取动态信息
     *
     * @param id
     * @return com.tanhua.model.mongoDb.Movement
     * @Author Pan Rundong
     */
    Movement getById(String id);

    /**
     * 动态点赞
     *
     * @param movementId
     * @param like
     * @param userId
     * @return java.lang.Boolean
     * @Author Pan Rundong
     */
    Boolean haveOrNot(String movementId, CommentType like, Long userId);

    /**
     * 分页查询动态
     *
     * @param page
     * @param pagesize
     * @param uid
     * @param state
     * @return com.tanhua.model.vo.PageResult
     * @Author Pan Rundong
     */
    PageResult findByState(Integer page, Integer pagesize, Long uid, Integer state);
}
